package com.ruoyi.combat.service.equiplocation.impl;

import java.util.List;

import com.ruoyi.combat.domain.equiplocation.CombatFakeIp;
import com.ruoyi.combat.mapper.equiplocation.CombatFakeIpMapper;
import com.ruoyi.combat.service.equiplocation.ICombatFakeIpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 虚假IPService业务层处理
 *
 * @author ruoyi
 * @date 2025-07-22
 */
@Service
public class CombatFakeIpServiceImpl implements ICombatFakeIpService {
    @Autowired
    private CombatFakeIpMapper combatFakeIpMapper;

    /**
     * 查询虚假IP
     *
     * @param id 虚假IP主键
     * @return 虚假IP
     */
    @Override
    public CombatFakeIp selectCombatFakeIpById(Long id) {
        return combatFakeIpMapper.selectCombatFakeIpById(id);
    }

    /**
     * 查询虚假IP列表
     *
     * @param combatFakeIp 虚假IP
     * @return 虚假IP
     */
    @Override
    public List<CombatFakeIp> selectCombatFakeIpList(CombatFakeIp combatFakeIp) {
        return combatFakeIpMapper.selectCombatFakeIpListNew(combatFakeIp);
    }

    /**
     * 新增虚假IP
     *
     * @param combatFakeIp 虚假IP
     * @return 结果
     */
    @Override
    public int insertCombatFakeIp(CombatFakeIp combatFakeIp) {
        return combatFakeIpMapper.insertCombatFakeIp(combatFakeIp);
    }

    /**
     * 修改虚假IP
     *
     * @param combatFakeIp 虚假IP
     * @return 结果
     */
    @Override
    public int updateCombatFakeIp(CombatFakeIp combatFakeIp) {
        return combatFakeIpMapper.updateCombatFakeIp(combatFakeIp);
    }

    /**
     * 批量删除虚假IP
     *
     * @param ids 需要删除的虚假IP主键
     * @return 结果
     */
    @Override
    public int deleteCombatFakeIpByIds(Long[] ids) {
        for (Long id : ids) {
            return combatFakeIpMapper.deleteCombatFakeIpById(id);
        }
        return ids.length;
    }

    /**
     * 删除虚假IP信息
     *
     * @param id 虚假IP主键
     * @return 结果
     */
    @Override
    public int deleteCombatFakeIpById(Long id) {
        return combatFakeIpMapper.deleteCombatFakeIpById(id);
    }
}
